package br.com.android.games.daedal;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

public class About extends Dialog implements android.view.View.OnClickListener {
	private View view;

	/**
	 * 
	 * @param context
	 */
	public About(Context context, View v) {
		super(context, R.style.Theme_Dialog);
		// super(context, android.R.style.Theme_Panel);
		setContentView(R.layout.dialog);
		//getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
		// getWindow().setBackgroundDrawable(new ColorDrawable(0));
		((Button) findViewById(R.id.btn_exit)).setOnClickListener(this);
		this.view = v;
		configClassicBnt();
	}

	/**
	 * 
	 */
	public void configClassicBnt() {
		ViewGroup  root = (ViewGroup) findViewById(R.id.root_about);

		View views[] = new View[root.getChildCount()];

		for (int i = 0; i < views.length; i++)
			views[i] = root.getChildAt(i);

		SelectScreen.setDefaultFont(views);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View v) {
		view.setVisibility(View.VISIBLE);
		view.postInvalidate();
		dismiss();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Dialog#onBackPressed()
	 */
	@Override
	public void onBackPressed() {
		onClick(null);
	}
}
